home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / CIncludes / SCSIPlugin.h < prev    next >
C/C++ Source or Header  |  1996-05-01  |  4KB  |  125 lines

  1. /*
  2.      File:        SCSIPlugin.h
  3.  
  4.      Contains:    Family defined Plugin exports and data structures
  5.  
  6.      Version:    Technology:    xxx put the technology version here xxx
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. */
  18. #ifndef __SCSIPLUGIN__
  19. #define __SCSIPLUGIN__
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24. #ifndef __KERNEL__
  25. #include <Kernel.h>
  26. #endif
  27. #ifndef __SCSI__
  28. #include <SCSI.h>
  29. #endif
  30.  
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34.  
  35. #if PRAGMA_IMPORT_SUPPORTED
  36. #pragma import on
  37. #endif
  38.  
  39. #if PRAGMA_ALIGN_SUPPORTED
  40. #pragma options align=power
  41. /* the following contents can only be used by compilers that support PowerPC struct alignment */
  42.  
  43. #if FOR_SYSTEM8_PREEMPTIVE
  44. /*
  45. ************************************************************************
  46.         Define entries to SIM routines
  47. ************************************************************************
  48.   SIMInitInfo PB
  49.      directions are for SCSIPluginInit call ( -> parm, <- result)             *|
  50.  need to change this to PluginControlBlock ***
  51. */
  52. typedef struct PluginControlBlock PluginControlBlock;
  53. struct PluginControlBlock {
  54.     UInt16                             ioPBSize;                    /* <- size of SCSI_IO_PBs required for this SIM            */
  55.     UInt16                             oldCallCapable;                /* <- true if this SIM can handle old-API calls            */
  56.     UInt16                             busID;                        /* <- bus number for the registered bus                    */
  57.     UInt8                             simSlotNumber;                /* <- Magic cookie to place in scsiHBASlotNumber (PCI)    */
  58.     UInt8                             simSRsrcID;                    /* <- Magic cookie to place in scsiSIMsRsrcID     (PCI)    */
  59.     Ptr                             simRegEntry;                /* -> The SIM's RegEntryIDPtr                    (PCI)    */
  60.     UInt32                             maxTargetID;                /* <- max Target ID of this bus*/
  61.     UInt32                             initiatorID;                /* <- comes from the NVRAM                                 */
  62.     UInt32                             scsiTimeout;                /* <- bus time out period*/
  63.     UInt32                             scsiFlagsSupported;            /* <- scsiFlags supported by this SIM*/
  64.     SInt16                             scsiSelectTimeout;            /* <- selection time out period*/
  65.     UInt16                             scsiIOFlagsSupported;        /* <- scsiIOFlags supported by this SIM*/
  66.     UInt32                             scsiDataTypes;                /* <- scsiDataType supported by this SIM*/
  67.  
  68.                                                                 /*  *** need to remove the following declares ASAP plugin is ready*/
  69.                                                                 /*    SCSIPluginActionEntry            scsiPluginAction;                    // address of SIM action routine*/
  70.                                                                 /*    SCSIPluginHandleBusEventEntry    scsiPluginHandleBusEvent;*/
  71.                                                                 /*    SCSIPluginInitEntry                scsiPluginInit;*/
  72. };
  73.  
  74. /* Define SIM calls passed into the family at initialize time*/
  75. typedef void (*SCSIPluginActionEntry)(SCSI_PB *scsiPB);
  76. typedef void (*SCSIPluginHandleBusEventEntry)(void *busEvent);
  77. typedef OSStatus (*SCSIPluginInitEntry)(PluginControlBlock *pcb);
  78.  
  79. enum {
  80.     kSCSIPluginVersion            = 0x02019600                    /* date and version *** temporary*/
  81. };
  82.  
  83. struct SCSIPluginInfo {
  84.     UInt32                             version;
  85.     UInt32                             reserved1;
  86.     UInt32                             reserved2;
  87.     UInt32                             reserved3;
  88. };
  89. typedef struct SCSIPluginInfo SCSIPluginInfo;
  90.  
  91. /* plugin needs to export this structure*/
  92. struct SCSIPluginDispatchTable {
  93.     SCSIPluginInfo                     header;
  94.     SCSIPluginActionEntry             scsiPluginAction;            /* address of SIM action routine*/
  95.     SCSIPluginHandleBusEventEntry     scsiPluginHandleBusEvent;
  96.     SCSIPluginInitEntry             scsiPluginInit;
  97. };
  98. typedef struct SCSIPluginDispatchTable SCSIPluginDispatchTable;
  99.  
  100. extern void SCSIPluginAction(SCSI_PB *scsiPB);
  101.  
  102. extern void SCSIPluginHandleBusEvent(void *busEvent);
  103.  
  104. extern OSStatus SCSIPluginInit(PluginControlBlock *pcb);
  105.  
  106. extern void SCSIFamMakeCallback(SCSI_PB *req);
  107.  
  108. extern OSStatus SCSIFamBusEventForSIM(UInt32 busID, void *busEvent);
  109.  
  110. #endif
  111.  
  112. #pragma options align=reset
  113. #endif /* PRAGMA_ALIGN_SUPPORTED */
  114.  
  115. #if PRAGMA_IMPORT_SUPPORTED
  116. #pragma import off
  117. #endif
  118.  
  119. #ifdef __cplusplus
  120. }
  121. #endif
  122.  
  123. #endif /* __SCSIPLUGIN__ */
  124.  
  125.